using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Runtime.Serialization;

namespace KPIS.GERP.Models.BGM
{
    [Table("bgm_mas_expense_group"), DataContract]
    public class MasBudgetExpenseGroup
    {
        public MasBudgetExpenseGroup()
        {
            //this.UsedMasBudgetExpenseGroupX = new HashSet<MasBudgetExpenseGroup>();
        }

        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        [DataMember, Display(Name = "BgExpGrpId", ResourceType = typeof(Resources.MasBudgetExpenseGroupResource))]
        [Column("bgm_exp_grp_seq", TypeName="int")]
        public int BgExpGrpId { get; set; }

        [DataMember, Display(Name = "Code", ResourceType = typeof(Resources.MasBudgetExpenseGroupResource))]
        [Column("bgm_exp_grp_code", TypeName="ntext")]
        public string Code { get; set; }

        [DataMember, Display(Name = "Name", ResourceType = typeof(Resources.MasBudgetExpenseGroupResource))]
        [Column("bgm_exp_grp_name", TypeName="ntext")]
        public string Name { get; set; }

        [DataMember, Display(Name = "Descr", ResourceType = typeof(Resources.MasBudgetExpenseGroupResource))]
        [Column("bgm_exp_grp_descr", TypeName="ntext")]
        public string Descr { get; set; }


        //[ForeignKey("MasBudgetExpenseGroupX")]
        [DataMember, Display(Name = "BgmExpGrpX", ResourceType = typeof(Resources.MasBudgetExpenseGroupResource))]
        [Column("bgm_exp_grp_x", TypeName="int")]
        public Nullable<int> BgmExpGrpX { get; set; }

        //[ForeignKey("MasBudgetSource")]
        [DataMember, Display(Name = "BgmSourceId", ResourceType = typeof(Resources.MasBudgetExpenseGroupResource))]
        [Column("bgm_source_seq", TypeName="int")]
        public Nullable<int> BgmSourceId { get; set; }

        [DataMember, Display(Name = "GfmisCode", ResourceType = typeof(Resources.MasBudgetExpenseGroupResource))]
        [Column("gfmis_code", TypeName="ntext")]
        public string GfmisCode { get; set; }

        //[DataMember]
        //public virtual MasBudgetSource MasBudgetSource { get; set; }

        //[DataMember]
        //public virtual MasBudgetExpenseGroup MasBudgetExpenseGroupX { get; set; }

        //[DataMember]
        //public virtual ICollection<MasBudgetExpenseGroup> UsedMasBudgetExpenseGroupX { get; set; }

        #region RecordStatus

        [DataMember, Display(Name = "RecordStatus", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        [Column("record_status", TypeName="ntext")]
        public string RecordStatus { get; set; }

        [DataMember, Display(Name = "CreatedBy", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        [Column("created_by", TypeName="int")]
        public Nullable<int> CreatedBy { get; set; }

        [DataMember, Display(Name = "CreatedWhen", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        [Column("created_when", TypeName="datetime2")]
        public Nullable<System.DateTime> CreatedWhen { get; set; }

        [DataMember, Display(Name = "UpdatedBy", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        [Column("updated_by", TypeName="int")]
        public Nullable<int> UpdatedBy { get; set; }

        [DataMember, Display(Name = "UpdatedWhen", ResourceType = typeof(SYS.Resources.RecordStatusResource))]
        [Column("updated_when", TypeName="datetime2")]
        public Nullable<System.DateTime> UpdatedWhen { get; set; }

        #endregion

    }
}